home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / Examine_kat.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  2KB  |  79 lines

  1. /*************************************************************************
  2.  Examine_kat.rexx  0.2 (1.3.96) by Eric Sauvageau
  3.  
  4.  Script for XPkatana - Will examine the specified file, returning 
  5.    informations about it.
  6.  Specifying "?" as the source file will open a file requester, asking for 
  7.    the source.
  8.  
  9.  Usage: Examine_kat.rexx <filename>
  10. **************************************************************************/
  11.  
  12.  
  13. /*** We want ANSWERS!!! :) ***/
  14. Options results
  15.  
  16. /***** 
  17.    We need to get the shell's path, so XPKatana will be able to
  18.    locate the desired source file.
  19. *****/
  20. path = Pragma('D','')
  21. If Right(path,1) ~= ':' Then path = path||'/'
  22.  
  23.  
  24. /*** I wanna talk to ya :) ***/
  25. Address 'KATANA'
  26.  
  27.  
  28. /*** Retrieve the arguments from the command line ***/
  29. Parse Arg source
  30.  
  31.  
  32. If source = "" Then Do
  33.    Say "You must supply a source file, or use "?" for a file requester."
  34.    Exit 10
  35. End
  36.  
  37.  
  38. /*** Tell XPKatana what is the source file. ***/
  39. SETSOURCE source ; found = result
  40.  
  41. /*****
  42.      If XPKatana can't find it, then try again, but adding the
  43.      current process's full path.
  44. *****/
  45. IF (found = 'NOFILE') & (source ~= '?') Then SETSOURCE path||source
  46.  
  47.  
  48. /*** Examine it ***/
  49.  
  50. EXAMINE ; string = result
  51.  
  52. If string = "NOFILE" Then Do
  53.    Say "Cannot find specified file!"
  54.    Exit 10
  55. End
  56.  
  57. If string = "ERROR" Then Do
  58.    Say "Error while examining file!"
  59.    Exit 10
  60. End
  61.  
  62.  
  63. /*** Parse the informations ***/
  64. Parse Var string filename packer encrypted ratio description
  65.  
  66.  
  67. /*** Now display the informations ***/
  68. Say "Informations on" filename||""
  69. Say ""
  70.  
  71. IF description ~= "" Then Say "Description: "||description
  72.  
  73. If packer ~= "#NONE" Then Do
  74.    Say "Packed with:" packer " - Efficiency:" ratio||"%"
  75.    If encrypted = "YES" Then Say "Encrypted."
  76. End
  77.  
  78. Exit
  79.